#ifndef WIDGET_BUY_H
#define WIDGET_BUY_H



#include "widget_human.h"
#include "widget_network.h"
#include "widget_ai.h"
#include "players.h"
#include "gui.h"



class human_widget;

class ai_widget;

class network_widget;



/** @brief Gui class for buying units
*
*   \image html widget_buy.jpeg
*/
class buy_widget:public QWidget
{

	Q_OBJECT

public:

	/** @brief Creates part of the gui
	*	@param parent Qt parent
	*	@param flags Qt flags
	*/
	buy_widget( QWidget* parent = 0, Qt::WindowFlags flags = 0 );

	
	/** @brief	Creates part of gui widget for specific type of the player
	*	@return	created widget
	*/
	QWidget* create_players_widget();

	//! @brief Jumps to next buy screen, or play widget and starts game, when all players are ready
	void show_next_turn();

	
	//! widget layout
	QVBoxLayout* layout;

	//! part of buy gui for local players
	human_widget* human_w;
	//! part of buy gui for AI players
	ai_widget* ai_w;
	//! part of buy gui for network players
	network_widget* network_w;

	//! current part of the gui
	QWidget* current_widget;


private:

	//! button NEXT
	QPushButton* next_b;


private slots:
	
	//! @brief Qt slot that jumps to next buy screen, or play widget and starts game, when all players are ready
	void next();


signals:

	//! @brief Qt singnal that sends commands to game core
	void send_command( player*, const string& );

};



#endif